﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Master/admin.Master" AutoEventWireup="true" CodeBehind="edit_comments.aspx.cs" Inherits="Ciripescu_WebRole.Admin.edit_comments" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    
    
    <br />
    <br />
<asp:ListView ID="ListView1" runat="server" DataSourceID="dsComments">
 <LayoutTemplate>
        <div id="article_container">
            <asp:PlaceHolder ID="itemPlaceholder" runat="server" />
        </div>
    </LayoutTemplate>        
        <ItemTemplate>
            <a href='<%#Eval("Url") %>' rel="nofollow"><%#Eval("Name") %></a>(<%#Eval("IP") %>)<br />
            <pre><%#Eval("Content")%></pre>
            <asp:Button ID="btnEdit" runat="server" Text="Edit" CommandName="Edit" />
            <asp:Button ID="btnDelete" runat="server" Text="Delete" CommandName="Delete"/>
            <hr />
        </ItemTemplate>
        <EditItemTemplate>
            <table>
            <tr>
                <td>Nume:</td>
                <td><asp:TextBox ID="txtName" runat="server" Text='<%#Bind("Name") %>'></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                        ErrorMessage="Trebuie sa bagi un nume (sau porecla sau ce vrei)" 
                        ControlToValidate="txtName"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td>Email:</td>
                <td><asp:TextBox ID="txtEmail" runat="server" Text='<%#Bind("Email") %>'></asp:TextBox></td>
            </tr>
            <tr>
                <td>Url:</td>
                <td><asp:TextBox ID="txtUrl" runat="server" Text='<%#Bind("Url") %>'></asp:TextBox></td>
            </tr>
            <tr>
                <td>*Comentariu:</td>
                <td><asp:TextBox ID="txtContent" runat="server" Height="156px" TextMode="MultiLine" 
                        Width="282px" Text='<%#Bind("Content") %>'> </asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                        ControlToValidate="txtContent" ErrorMessage="Ai uitat ce ai vrut sa zici?"></asp:RequiredFieldValidator>                    
                </td>
            </tr>
            <tr>
                <td>Admin Reply:</td>
                <td><asp:TextBox ID="txtAdminReply" runat="server" Height="156px" TextMode="MultiLine" 
                        Width="282px" Text='<%#Bind("AdminReply") %>'> </asp:TextBox>                    
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <asp:CheckBox ID="CheckBox1" runat="server" Checked='<%#Bind("IsAproved") %>' /></td>
            </tr>
            <tr>
                <td colspan="2">
                    <asp:Button ID="UpdateButton" runat="server" CommandName="Update" Text="Update" />
                    <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="Cancel" />
                    <asp:HiddenField ID="HiddenField1" runat="server" Value='<%#Bind("User") %>' />
                    <asp:HiddenField ID="HiddenField2" runat="server" Value='<%#Bind("IP") %>' />
                    <asp:HiddenField ID="HiddenField3" runat="server" Value='<%#Bind("PartitionKey") %>' />
                    <asp:HiddenField ID="HiddenField4" runat="server" Value='<%#Bind("RowKey") %>' />
                    <asp:HiddenField ID="HiddenField5" runat="server" Value='<%#Bind("Date") %>' />
                </td>
            </tr>
        </table>
        </EditItemTemplate>
    </asp:ListView>
    <asp:DataPager ID="DataPager1" runat="server" PagedControlID="ListView1" 
        PageSize="20">
        <Fields>
            <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" 
                ShowNextPageButton="False" ShowPreviousPageButton="False" />
            <asp:NumericPagerField />
            <asp:NextPreviousPagerField ButtonType="Button" ShowLastPageButton="True" 
                ShowNextPageButton="False" ShowPreviousPageButton="False" />
        </Fields>
    </asp:DataPager>
    <asp:ObjectDataSource ID="dsComments" runat="server" 
        DataObjectTypeName="Ciripescu_WebRole.Entities.Comment" DeleteMethod="DeleteWithoutQ" 
        InsertMethod="Insert" SelectMethod="GetAllItemsStatic" 
        TypeName="Ciripescu_WebRole.BL.CommentManager" UpdateMethod="AttachAndSave">
    </asp:ObjectDataSource>
</asp:Content>
